using Provausio.Common.Objects;
using TrainingManagement.api.Models.BusinessObjects.Responses;
using TrainingManagement.api.Models.Data.CRUD;
using TrainingManagement.api.Models.Data.CRUD.SkillSet;

namespace TrainingManagement.api.Models.BusinessLogic.SkillSet
{
    public class SkillSetDeleteOperation : BusinessOperation<int, GeneralResponse>
    {
        private readonly SkillSetDeleteDataSource _skillSetDelete = new SkillSetDeleteDataSource();

        public override GeneralResponse Run(int input)
        {
            var resp = new GeneralResponse();
            if (_skillSetDelete.Execute(input))
            {
                resp.Message = "Skill Set was deleted successfully!";
                resp.StatusCode = 200;
                return resp;
            }
            resp.Message = "Skill Set was not deleted!";
            resp.StatusCode = 500;
            return resp;
        }
    }
}